package com.xframe.domain.e3sp.bu.sale;

import com.xframe.domain.BaseModel;
import com.xframe.domain.e3sp.maindata.SparePartBaseView;
import com.xframe.xdal.core.annotation.AutoFill;
import com.xframe.xdal.core.annotation.XBelongsTo;
import com.xframe.xdal.core.annotation.XColumn;
import com.xframe.xdal.core.annotation.XTable;
import com.xframe.xdal.core.constant.AutoFillType;
import io.swagger.models.auth.In;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;

/**
 * @author zjj
 * @create 2024/4/24 15:43
 */

@Data
@Accessors(chain=true)
@XTable(value = "bu_t01_part_flvalue", label = "备件波动值",dataSourceCode = "warehouse")
@XBelongsTo(typeName = "com.xframe.domain.e3sp.maindata.SparePartBaseView",foreignKey = "sparePartId", targetKey = "sparePartId",as = "refSparePartBaseView")
public class PartFlvalue extends BaseModel {

    /**
     * 经销商波动值ID
     */
    @AutoFill(AutoFillType.Snowflake)
    @XColumn(name = "part_flvalue_id", primaryKeyFlag = true,desc = "备件波动值ID")
    private Long partFlvalueId;

    /**
     * 备件清单ID
     */
    @XColumn(name = "spare_part_id", desc = "备件清单ID")
    private Long sparePartId;

    /**
     * 采购数量的和
     */
    @XColumn(name = "num", desc = "采购数量的和")
    private Integer num;

    /**
     * 平均采购量 = 采购数量的和 / 180
     */
    @XColumn(name = "bf_value", desc = "平均采购量")
    private BigDecimal bfValue;

    /**
     * 备件
     */
    private SparePartBaseView refSparePartBaseView;

}
